package com.zlkj.pro.modular.app.controller;

import cn.stylefeng.roses.kernel.rule.pojo.response.ResponseData;
import cn.stylefeng.roses.kernel.rule.pojo.response.SuccessResponseData;
import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
import cn.stylefeng.roses.kernel.scanner.api.annotation.GetResource;
import cn.stylefeng.roses.kernel.scanner.api.annotation.PostResource;
import com.zlkj.pro.modular.app.service.AppCustomerContactsService;
import com.zlkj.pro.modular.app.service.AppProductService;
import com.zlkj.pro.modular.business.model.dto.CustomerContactsDTO;
import com.zlkj.pro.modular.business.model.dto.ProductInfoDTO;
import com.zlkj.pro.modular.business.model.vo.CustomerContactsVO;
import com.zlkj.pro.modular.business.model.vo.ProductInfoVO;
import com.zlkj.pro.modular.business.model.vo.ProductTypeVO;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

import static com.zlkj.pro.core.consts.ProjectConstants.SERVICE_APP_PREFIX;

/**
 * @author liyang
 * @date 2024/4/6
 * @time 14:34
 */
@Slf4j
@RestController
@RequiredArgsConstructor
@ApiResource(name = "产品信息", path = SERVICE_APP_PREFIX + "/product")
public class AppProductController {

    private final AppProductService appProductService;

    @GetResource(name = "产品列表", path = "/findList")
    public ResponseData findList(ProductInfoDTO dto) {
        List<ProductTypeVO> restData = appProductService.findList(dto);
        return new SuccessResponseData(restData);
    }

    @GetResource(name = "查询产品详情", path = "/findDetail")
    public ResponseData findDetail(Long id) {
        ProductInfoVO restData = appProductService.findDetail(id);
        return new SuccessResponseData(restData);
    }

}
